/**************************************************************************
	File		: if.h
	Author		: TaoLei Zhang
	Date		: 2018-2-7
***************************************************************************/
#ifndef _IF_H_
#define _IF_H_

/**************************************************************************
    								include
***************************************************************************/
#include "Common.h"
#include <time.h>
#include <stdint.h>
#include <pthread.h>
#include <windows.h>
#include "McuMsg.h"
#include "DI_McuIfPublic.h"


/**************************************************************************
    								macro
***************************************************************************/

/**************************************************************************
    								typedef
***************************************************************************/
typedef struct tagMcuIfCtx_t
{
	char contrlDev[64];
	HANDLE hCom;
	pthread_t thread;
	pthread_mutex_t mutex;
	ThreadState_e threadState;
	McuChangeFn_f cb;
	OVERLAPPED m_OverlappedRead;
	OVERLAPPED m_OverlappedWrite;
}McuIfCtx_t;

typedef uint64_t TimeType;
#define TimeTypeFormat "%llu"

/**************************************************************************
    								variables
***************************************************************************/
extern 	McuMsg_t g_Msg_rx;
extern volatile uint16_t g_ReqId;
extern volatile uint16_t g_McuReqState;
extern volatile uint16_t g_McuErrCode;
extern PrintfFunc McuIfPrint;
/**************************************************************************
    								functions
***************************************************************************/
__inline static TimeType GetSysMs() {
	clock_t time;

	time = clock();
}

#endif

